Re-enable and fix a couple of try_void related specs#304
Conversation
bdbefd3 to
79ea5d3
Compare
Turned out reusability was pretty low. Co-Authored-By: Rainer Dema <rainer.dema@gmail.com>
Canceling an order will try to access `spree_current_user` in order to pass it to `Order#canceled_by`. Co-Authored-By: Rainer Dema <rainer.dema@gmail.com>
Canceling an order with a captured payment leaves the payment as complete and performs a refund. Co-Authored-By: Rainer Dema <rainer.dema@gmail.com>
Co-Authored-By: Rainer Dema <rainer.dema@gmail.com>
79ea5d3 to
2979d7e
Compare
Codecov Report
@@ Coverage Diff @@
## main #304 +/- ##
=======================================
Coverage 99.63% 99.63%
=======================================
Files 30 30
Lines 546 546
=======================================
Hits 544 544
Misses 2 2 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
waiting-for-dev
left a comment
There was a problem hiding this comment.
Thanks! 🚀
I'd still leave the backend helpers extracted into methods, mainly for consistency and better readability, but I leave it to your call 🙂
|
@waiting-for-dev we initially tried that approach but eventually we rolled it back because there was little to no reuse, as the combinations of flash messages and payment statuses were always different. Maybe there's a case for using I18n here, but that also as its own downsides, and is usually better to use raw values rather than dynamic ones in tests to avoid the equivalent of circular definitions. |
Summary
The implementation was fine, just had to adjust the expectation and test setup.
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: